// 1: 如果num > target

// -1：如果num < target

// 0：如果num = target
#include<bits/stdc++.h>

using namespace std;

int target = INT32_MAX - 1;

int check(int num) {
    if (num == target) return 0;
    if (num > target) return 1;
    if (num < target) return -1;
    return -2;
}
//check已在tools.h中定义，你可以通过check(int)调用
int guessNumber() {
    //write ur code here.
    if (check(INT32_MIN) == 0) return INT32_MIN;
    if (check(INT32_MAX) == 0) return INT32_MAX;
    long long l = INT32_MIN, r = INT32_MAX;
    while (l <= r)
    {
        long long mid = ((r - l) >> 1) + l;
        switch (check((int)mid))
        {
        case(0): return (int)mid;
        case(1): r = mid - 1;
            break;
        case(-1): l = mid + 1;
            break;
        default:
            break;
        }
    }
    return -1;
}


// #include "tools.h"
int main(){
    cout << guessNumber();
}